//节流
function throttle(fn, wait) {
    let prev = 0; //上次记录的时间
    return function() {
        let now = Date.now();

        if (now - prev > wait) {

            fn.apply(this, arguments) //执行函数，发送请求
            prev = now;
        }
    }
}
module.exports = {
    throttle
}